package org.cc.cloud;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.health.Status;
import org.springframework.stereotype.Component;

import com.netflix.appinfo.HealthCheckHandler;
import com.netflix.appinfo.InstanceInfo.InstanceStatus;

@Component
public class MyHealthCheckHandler implements HealthCheckHandler {
    @Autowired
	public  MyHealthIndicator  myHealthIndicator1;
	public InstanceStatus getStatus(InstanceStatus currentStatus) {
		Status status=myHealthIndicator1.health().getStatus();
		if(status.equals(Status.UP))
			return  InstanceStatus.UP;
		else
			return  InstanceStatus.DOWN;
		// TODO Auto-generated method stub
		//return null;
	}

}
